<template>
    <div id="login-page">
        <div class="content">
            <div class="img">
                <img src="../../assets/images/hourglass@2x.png" class="login">
            </div>
            <span>登录中，请稍等...</span>
        </div>


    </div>
</template>


<script>
export default {
  data() {
    return {};
  },

  activated() {
    this.toLogin();
  },
  components: {},
  computed: {},
  mounted() {},

  methods: {
    async toLogin() {
      let key = this.$route.query.pkey;
      let api = '';
      let json = {};
      switch (key) {
      case '1':
        api = 'plugin.tx-third-login.api.index.index';
        break;
      default:
        break;
      }
      if(this.$route.query.pluParams) json.pluParams = this.$route.query.pluParams;//额外参数
      if(this.$route.query.test) json.test = 1;//测试环境参数
      let { result, msg, data } = await $http.get(api,json,".");
      if(result == 0) return this.$toast(msg);
      if(data.url) window.location.href = data.url;
    }
  }
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#login-page {
  background-color: #fff;
  min-height: 41.6875rem;
  padding-top: 7.5rem;

  .content {
    .img {
      width: 3.75rem;
      height: 3.75rem;
      line-height: 3.75rem;
      overflow: hidden;
      margin: 0 auto;
      transform-origin: 50% 50%;
      animation-duration: 2s;
      animation-iteration-count: infinite;
      position: relative;
      animation-name: img;
      text-align: center;

      @keyframes img {
        from { transition: 1s ease-in; }
        to { transform: rotate(360deg); }
      }

      img {
        height: 60%;
        display: inline-block;
        vertical-align: middle;
      }
    }
  }

  span {
    font-size: 16px;
    line-height: 1.875rem;
  }
}
</style>
